<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui"
	xmlns:ui="http://java.sun.com/jsf/facelets">

<p:dialog id="idDialogAddApostila" header="Adicionar apostila"
	widgetVar="dialogAddApostila" modal="true" dynamic="true"
	appendToBody="true" resizable="false" width="500" hideEffect="explode">

	<h:form id="frmDialogAddApostila" enctype="multipart/form-data">
		<p:panelGrid style="width:100%;">
			<p:row>
				<p:column>
					<h:outputText
						value="Prova: #{provaManagedBean.provaSelecionada.titulo}" />
				</p:column>
			</p:row>
			<p:row>
				<p:column>

					<p:fileUpload fileLimitMessage="Arquivo muito grande."
						update="frmDialogAddApostila :frmProvaDataTable :message"
						sizeLimit="100000000" mode="simple"
						value="#{provaManagedBean.fileUpload}" allowTypes="*.*;" />

				</p:column>
			</p:row>

			<p:row>
				<p:column>
					<p:separator />
				</p:column>
			</p:row>

			<p:row>
				<p:column>
					<div align="right">
						<p:commandButton value="Cancelar" type="button"
							onclick="dialogAddApostila.hide()" />
						<p:commandButton value="OK" ajax="false"
							actionListener="#{provaManagedBean.apostilaUpload}"
							oncomplete="if(!args.validationFailed) dialogAddApostila.hide(); 
							else dialogAddApostila.show();" />
					</div>
				</p:column>
			</p:row>
		</p:panelGrid>
	</h:form>
</p:dialog>
</html>